home *** CD-ROM | disk | FTP | other *** search
-
- Listing 1: Traditional getopt(3) Command Line Processing
- =========================================================
-
- while ((option = getopt (argc, argv, optstring)) != -1) {
- switch (option) {
- case 'a': ... ; break ; /* Options */
- case 'b': ... ; break ;
- ...
- case '?': ... error ...
- default: break ;
- }
- }
- while (optind < argc) { /* Non-option arguments */
- ... process argv[optind++] ...
- }
-
-
-